.class public Ldgb/p4;
.super Ljava/lang/Object;
.source "SourceFile"


# static fields
.field private static final f:Ljava/lang/Long;

.field private static g:Ldgb/p4;


# instance fields
.field private a:Landroid/content/Context;

.field private b:Landroid/app/AlarmManager;

.field private c:Landroid/app/PendingIntent;

.field private d:Z

.field private e:J


# direct methods
.method static constructor <clinit>()V
    .locals 2

    const-wide/32 v0, 0x1b7740

    .line 1
    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v0

    sput-object v0, Ldgb/p4;->f:Ljava/lang/Long;

    return-void
.end method

.method private constructor <init>(Landroid/content/Context;)V
    .locals 4

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    iput-object p1, p0, Ldgb/p4;->a:Landroid/content/Context;

    const-string v0, "alarm"

    .line 3
    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/app/AlarmManager;

    iput-object p1, p0, Ldgb/p4;->b:Landroid/app/AlarmManager;

    .line 4
    new-instance p1, Landroid/content/Intent;

    const-string v0, "CoreAlarmReceiver"

    invoke-direct {p1, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 5
    iget-object v0, p0, Ldgb/p4;->a:Landroid/content/Context;

    const/4 v1, 0x0

    const/high16 v2, 0x8000000

    invoke-static {v0, v1, p1, v2}, Landroid/app/PendingIntent;->getBroadcast(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object p1

    iput-object p1, p0, Ldgb/p4;->c:Landroid/app/PendingIntent;

    const-wide/16 v2, -0x1

    .line 6
    iput-wide v2, p0, Ldgb/p4;->e:J

    .line 7
    iput-boolean v1, p0, Ldgb/p4;->d:Z

    return-void
.end method

.method public static a(Landroid/content/Context;)Ldgb/p4;
    .locals 2

    .line 1
    const-class v0, Ldgb/p4;

    monitor-enter v0

    .line 2
    :try_start_0
    sget-object v1, Ldgb/p4;->g:Ldgb/p4;

    if-nez v1, :cond_0

    .line 3
    new-instance v1, Ldgb/p4;

    invoke-direct {v1, p0}, Ldgb/p4;-><init>(Landroid/content/Context;)V

    sput-object v1, Ldgb/p4;->g:Ldgb/p4;

    .line 4
    :cond_0
    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 5
    sget-object p0, Ldgb/p4;->g:Ldgb/p4;

    return-object p0

    :catchall_0
    move-exception p0

    .line 6
    :try_start_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw p0
.end method

.method private c()Z
    .locals 5

    .line 1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-wide v2, p0, Ldgb/p4;->e:J

    sub-long/2addr v0, v2

    const-wide/32 v2, 0xea60

    cmp-long v4, v0, v2

    if-lez v4, :cond_0

    const/4 v0, 0x1

    goto :goto_0

    :cond_0
    const/4 v0, 0x0

    :goto_0
    return v0
.end method


# virtual methods
.method public a()V
    .locals 9

    .line 7
    iget-boolean v0, p0, Ldgb/p4;->d:Z

    if-nez v0, :cond_1

    .line 8
    sget-boolean v0, Ldgb/z;->b:Z

    if-eqz v0, :cond_0

    const-string v0, "stat.Alarm"

    const-string v1, "Start to regist alarm!"

    .line 9
    invoke-static {v0, v1}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 10
    :cond_0
    iget-object v0, p0, Ldgb/p4;->b:Landroid/app/AlarmManager;

    iget-object v1, p0, Ldgb/p4;->c:Landroid/app/PendingIntent;

    invoke-virtual {v0, v1}, Landroid/app/AlarmManager;->cancel(Landroid/app/PendingIntent;)V

    .line 11
    iget-object v2, p0, Ldgb/p4;->b:Landroid/app/AlarmManager;

    const/4 v3, 0x1

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v4

    sget-object v0, Ldgb/p4;->f:Ljava/lang/Long;

    invoke-virtual {v0}, Ljava/lang/Long;->longValue()J

    move-result-wide v6

    iget-object v8, p0, Ldgb/p4;->c:Landroid/app/PendingIntent;

    invoke-virtual/range {v2 .. v8}, Landroid/app/AlarmManager;->setRepeating(IJJLandroid/app/PendingIntent;)V

    const/4 v0, 0x1

    .line 12
    iput-boolean v0, p0, Ldgb/p4;->d:Z

    .line 13
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Ldgb/p4;->e:J

    :cond_1
    return-void
.end method

.method public b()V
    .locals 3

    .line 1
    iget-boolean v0, p0, Ldgb/p4;->d:Z

    if-eqz v0, :cond_1

    invoke-direct {p0}, Ldgb/p4;->c()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 2
    sget-boolean v0, Ldgb/z;->b:Z

    if-eqz v0, :cond_0

    .line 3
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "Start to unRegist alarm, The last register time is "

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v1, p0, Ldgb/p4;->e:J

    invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "stat.Alarm"

    invoke-static {v1, v0}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I

    .line 4
    :cond_0
    iget-object v0, p0, Ldgb/p4;->b:Landroid/app/AlarmManager;

    iget-object v1, p0, Ldgb/p4;->c:Landroid/app/PendingIntent;

    invoke-virtual {v0, v1}, Landroid/app/AlarmManager;->cancel(Landroid/app/PendingIntent;)V

    const/4 v0, 0x0

    .line 5
    iput-boolean v0, p0, Ldgb/p4;->d:Z

    :cond_1
    return-void
.end method
